package at.fhj.antesk.steamvaluecalc;

public class Game {

	private int id;
	private String name;
	private String logo;
	private String storeLink;
	private double hoursOnRecord;
	private double price = 0.0;
	private double hourValue = 0.0;

	public Game(String name, String logo, String storeLink, double hoursOnRecord) {
		super();
		this.name = name;
		this.logo = logo;
		this.storeLink = storeLink;
		this.hoursOnRecord = hoursOnRecord;
	}

	public Game(int id, String name, String logo, String storeLink, double hoursOnRecord) {
		super();
		this.id = id;
		this.name = name;
		this.logo = logo;
		this.storeLink = storeLink;
		this.hoursOnRecord = hoursOnRecord;
	}

	public Game() {

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getStoreLink() {
		return storeLink;
	}

	public void setStoreLink(String storeLink) {
		this.storeLink = storeLink;
	}

	public double getHoursOnRecord() {
		return hoursOnRecord;
	}

	public void setHoursOnRecord(double hoursOnRecord) {
		this.hoursOnRecord = hoursOnRecord;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public double getHourValue() {
		return hourValue;
	}

	public void setHourValue(double hourValue) {
		this.hourValue = hourValue;
	}

	@Override
	public String toString() {
		return "Game name=" + name + "\nlogo=" + logo + "\nstoreLink=" + storeLink + "\nhoursOnRecord=" + hoursOnRecord
				+ "\nprice=" + price;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(hoursOnRecord);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((logo == null) ? 0 : logo.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		temp = Double.doubleToLongBits(price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((storeLink == null) ? 0 : storeLink.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Game other = (Game) obj;
		if (Double.doubleToLongBits(hoursOnRecord) != Double.doubleToLongBits(other.hoursOnRecord))
			return false;
		if (logo == null) {
			if (other.logo != null)
				return false;
		} else if (!logo.equals(other.logo))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (Double.doubleToLongBits(price) != Double.doubleToLongBits(other.price))
			return false;
		if (storeLink == null) {
			if (other.storeLink != null)
				return false;
		} else if (!storeLink.equals(other.storeLink))
			return false;
		return true;
	}

}
